﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using DAL;

namespace word.winform
{
    public partial class AddGoodsType : Form
    {
        public AddGoodsType()
        {
            InitializeComponent();
        }

        private void button2_Click(object sender, EventArgs e)
        {
            this.Close();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            String sql = $"INSERT INTO [dbo].[Types](T_Name,t_Description) values('{TB_Type.Text.ToString()}','{RTB_describe.Text.ToString()}')";
            if (DBHelper.query(sql))
            {
                MessageBox.Show("商品类别添加成功", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            else
            {
                MessageBox.Show("商品类别添加失败", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
    }
}
